-- GENERATED SPELL FOR [Kiggler the Crazed] --


function spell0_18835(pUnit, Event) --@Arcane Explosion,Self--
pUnit:FullCastSpellOnTarget(33237,pUnit)
pUnit:RegisterEvent('Sorts_18835', 632, 1)
end

function spell1_18835(pUnit, Event) --@Arcane Shock,n/a--
pUnit:FullCastSpellOnTarget(33175,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_18835', 5316, 1)
end

function spell2_18835(pUnit, Event) --@Greater Polymorph,n/a--
pUnit:FullCastSpellOnTarget(33173,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_18835', 10305, 1)
end

function spell3_18835(pUnit, Event) --@Lightning Bolt,n/a--
pUnit:FullCastSpellOnTarget(36152,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_18835', 2000, 1)
end

function Sorts_18835(pUnit, Event)
local choix_sorts_18835 = math.random(0, 3)
if choix_sorts_18835 == 0 then
pUnit:RegisterEvent('spell0_18835', 1, 1)
end
if choix_sorts_18835 == 1 then
pUnit:RegisterEvent('spell1_18835', 1, 1)
end
if choix_sorts_18835 == 2 then
pUnit:RegisterEvent('spell2_18835', 1, 1)
end
if choix_sorts_18835 == 3 then
pUnit:RegisterEvent('spell3_18835', 1, 1)
end
end

function mob18835_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_18835', math.random(1500, 3000), 1)
end

function mob18835_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob18835_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob18835_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(18835, 1, 'mob18835_Action')
RegisterUnitEvent(18835, 2, 'mob18835_Leave')
RegisterUnitEvent(18835, 3, 'mob18835_Kill')
RegisterUnitEvent(18835, 4, 'mob18835_Die')
